home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Sound / SndPlayDoubleBuffer / _headers / SimpleApp_Sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-15  |  2.0 KB  |  64 lines  |  [TEXT/CWIE]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    Header for SimpleQT functions using SimpleApp framework.
  5. **
  6. **    by Mark Cookson, Apple Developer Technical Support
  7. **
  8. **    File:    SimpleApp_Sound.h
  9. **
  10. **    Copyright ©1996 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "Apple Sample
  17. **    Code" after having made changes. If you're going to re-distribute the
  18. **    source, we require that you make it clear in the source that the code
  19. **    was descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #include    <Windows.h>
  23.  
  24. #include    "SimpleApp.h"
  25. #include    "DBFF.h"
  26.  
  27. #define    oneBuffer                (1)
  28. #define    tenBuffers                (10)
  29. #define    soundPlaying            (!ASoundIsDone (mySoundInfo) && !paused)
  30. #define    qtStyle                    0
  31. #define    cdStyle                    1
  32. #define kScrollMinValue            1
  33.  
  34. /* Globals */
  35. ControlHandle            startButton        = nil,
  36.                         stopButton        = nil,
  37.                         resumeButton    = nil,
  38.                         scrollBar        = nil,
  39.                         checkBox        = nil;
  40. Boolean                    CDStyle            = false,        /* false means QuickTime style scrolling */
  41.                         gPlayBackwards    = false,        /* should we play backwards? */
  42.                         paused            = false,        /* are we currently paused? */
  43.                         stopped            = false,        /* are we currently stopped? */
  44.                         gDone            = false;
  45. SoundInfoPtr            mySoundInfo        = nil;
  46. GrafPtr                    gTheWindow        = nil;
  47. Str255                    gOldWindowTitle;
  48.  
  49. /* Function declarations */
  50. pascal    void    DoScroll        (ControlHandle control, short part);
  51. pascal    void    MyScrollAction    (ControlHandle control, short part);
  52.         short    DoPlay            (void);
  53.         short    DoPause            (void);
  54.         void    MyIdleProc        (EventRecord *evt);
  55.         OSErr    DoStop            (void);
  56. pascal    short    DoPostGroupHit    (long  modifiers,
  57.                                 ControlRef theControl,
  58.                                 ButtonItemRecHandle brh,
  59.                                 short item);
  60.         short    DoPlayBackwards    (long modifiers);
  61.         void    main            (void);
  62.         void    EnableControl    (ControlRef cr);
  63.         void     DisableControl    (ControlRef cr);
  64.